import request from '@/utils/request'
import { timeFormat }  from '@/utils/dateUtil'
const api = {}

//商品搜索日志查询
api.query = data => {
    let p = request({
      url: `/log/goodsSearchLog/query`,
      method: 'get',
      params: data
    })
    p = p.then(res=>{
      res.data.page.list.forEach(e=>{
        e.searchTime = timeFormat(e.searchTime)
      })
      return res.data.page
    })
    return p
  }


  // 商品搜索排行前十统计查询
  api.goodsSearchStatistics = type => {
    return request({
      url: `/log/goodsSearchLog/goodsSearchStatistics?type=${type}`,
      method: 'get'
    })
  }

  // 全国地区分布图数据
  



  export default api